import numpy as np
import matplotlib.pyplot as plt

x = np.linspace(0,2*np.pi,100)
# print(x)
y = np.sin(x)

#创建figure对象
# fig = plt.figure()
# ax = fig.add_axes((0.15,0.1,0.7,0.8))
# #绘制折线图
# ax.plot(x,y)
#
# ax = fig.add_axes((0.3,0.4,0.7,0.8))
# #绘制折线图
# ax.plot(x,y)
fig,ax = plt.subplots(2, 2)
ax[0,0].plot(x,np.sinc(x))
ax[1,1].plot(x,np.sinc(2 * x))
plt.show()